package at.ac.tuwien.infosys.aic11.dto;


import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "customer")
@XmlAccessorType(XmlAccessType.NONE)
public class Customer {
        
		//disbursement service expects element name in this style
        @XmlAttribute(name="customerId", required=true)
        private long customerId;
        
        @XmlElement(name="firstName", required=true)
        private String firstName;
        
        @XmlElement(name="middleName", required=true)
        private String middleName;
        
        @XmlElement(name="lastName", required=true)
        private String lastName;
        
        @XmlElement(name="address", required=true)
        private Address address;
        
        

        
        public Customer() {}
        
        public Customer(long customerId, String firstName, String middleName, 
                        String lastName, Address address
                        ){
                this.customerId=customerId;
                this.firstName=firstName;
                this.middleName=middleName;
                this.lastName=lastName;
                this.address=address;
                }
        
        public Customer(InternalCustomer c) {
                this.customerId=c.getCustomerId();
                this.firstName=c.getFirstName();
                this.middleName=c.getMiddleName();
                this.lastName=c.getLastName();
                this.address=c.getAddress();
        }
        
        public long getCustomerId() {
                return customerId;
        }
        public void setCustomerId(long customerId) {
                this.customerId = customerId;
        }
        public String getFirstName() {
                return firstName;
        }
        public void setFirstName(String firstName) {
                this.firstName = firstName;
        }
        public String getMiddleName() {
                return middleName;
        }
        public void setMiddleName(String middleName) {
                this.middleName = middleName;
        }
        public String getLastName() {
                return lastName;
        }
        public void setLastName(String lastName) {
                this.lastName = lastName;
        }
        public Address getAddress() {
                return address;
        }

        public void setAddress(Address address) {
                this.address = address;
        }

                
        public String toString(){
                return "customerId: "+customerId+" firstname: "+firstName+" middleName: "+middleName+" lastName: "+lastName+" address: "+address.toString();
        }
}